<!DOCTYPE html>
<html  lang="en">
    <head>
        <title>Document</title>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    </head>
    <body>
        <div id="app">
            <h3>自动聚焦指令</h3>
            <input type="text" v-focus>
        </div>

        <script>
            Vue.directive("focus",function(el,bind){
                el.focus()
            })
            let vm = new Vue({
                el: '#app',
            })
        </script>
    </body>
</html>